home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / lightwave / lwmlist / 94.lightwave-10 / 000327_owner-lightwave-l _Wed Oct 19 07:39:06 1994.msg < prev    next >
Internet Message Format  |  1994-11-05  |  3KB

  1. Return-Path: <owner-lightwave-l>
  2. Received: by mail.netcom.com (8.6.9/Netcom)
  3.     id EAA26094; Wed, 19 Oct 1994 04:58:26 -0700
  4. Received: from westford.ccur.com by mail.netcom.com (8.6.9/Netcom)
  5.     id EAA26087; Wed, 19 Oct 1994 04:58:22 -0700
  6. Received: from [192.5.25.14] by masscomp.westford.ccur.com
  7.           via TCP/IP with SMTP id aa07909; 19 Oct 94 7:51 EDT
  8. Received: from smokey.arl.mil by SMOKEY.ARL.MIL id aa00655; 19 Oct 94 6:42 EDT
  9. Received: from admii.arl.mil by SMOKEY.ARL.MIL id aa00567; 19 Oct 94 6:31 EDT
  10. Received: from USENET by ADMII.ARL.MIL id aa24464; 19 Oct 94 6:31 EDT
  11. Newsgroups: comp.lang.pascal
  12. Subject: Re: Initializing controls in dialog
  13. Message-ID: <ZWEITZE.417.004050D7@ET.TUDelft.NL>
  14. From: Zweitze de Vries <ZWEITZE@et.tudelft.nl>
  15. Date: Wed, 19 Oct 1994 10:24:57 UNDEFINED
  16. Nntp-Posting-Host: zdvries.et.tudelft.nl
  17. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
  18. To: info-pascal@arl.mil
  19. Sender: owner-lightwave-l@netcom.com
  20. Precedence: bulk
  21. Reply-To: lightwave-l@netcom.com
  22.  
  23. In article <d8.11491.12.0NE15089@pdprog.com> 
  24. pete@pdprog.com (Pete Doronzio) writes:
  25.  
  26. >I've got a dialog (TDialog descendant) which contains a simple rectangle
  27. >as one of its controls.  I use it simply to have some coordinates to
  28. >draw in.  Specifically, I draw a sample of the current selection in it
  29. >everytime an attribute is changed.  I do this by getting a handle to the
  30. >control, creating a DC off it's HWND and drawing.
  31.  
  32. >It all works great... (well, not _all_)
  33.  
  34. >Since the control's HWND does not exist during the setupWindow call, I
  35. >can't paint the initial sample when the dialog first comes up.
  36.  
  37. During TDialog.SetupWindow, all controls exist and their HWNDs are
  38. valid. They're just not visible. When they become visible, each window
  39. receives WM_SHOW, WM_PAINT, WM_NCPAINT, etc. etc. (don't know which order).
  40.  
  41. >Is there a method which gets called after the controls have been
  42. >created, but before they are displayed?  Or is the only way to do this
  43. >to send a message to update after the dialog is created and on-screen?
  44.  
  45. You can set a boolean, and decide what to do on WM_PAINT.
  46. Or you can post a userdefined message.
  47.  
  48. Best (I think) is moving all drawing stuff to the WM_PAINT handler.
  49. When an attribute is changed, simply pass the new attributes, and
  50. invalidate (some part of) the window. In this case you don't have 
  51. to worry when another window is moved over your dialog, and moved 
  52. away after that.
  53.  
  54. Bye,
  55. --
  56. Zweitze de Vries                       Z.A.deVries@ET.TUDelft.NL
  57. Faculty of Electrical Engineering
  58. Delft University of Technology
  59. Netherlands                            Never trust a virtual machine